%function modeFinderFlags 

%==========================================================================
% Determine if flags.mixedFreq and flags.initialCond are properly
% specified 

% flags.mixedFreq==1    if model is in mixed frequency 
% flags.initialCond==1  if initial state and variance provided 
if flags.mixedFreq~=0 && flags.mixedFreq~=1 
    error('flags.mixedFreq must be 0 or 1') 
end 
if flags.initialCond~=0 && flags.initialCond~=1 
    error('flags.initialCond must be 0 or 1') 
end 

%% flags.initialCond = If providing Initial Condition 
if flags.initialCond==1 
    disp('flags.initialCond==1');
    %warning('Commented out lines here asking for pZero and aZero - Todd')
    disp('Must supply aZero and Pzero in filterStru')
    if isfield(filterStru,'pZero')==false || isempty(filterStru.pZero)==true
        error('Missing addsol.pZero')
    end
    if isfield(filterStru,'aZero')==false || isempty(filterStru.aZero)==true
        error('Missing addsol.aZero')
    end
else 
    addsol.flags.initialCond=false;
end 

if isfield(flags,'parallel')==false 
    error('Need flags.parallel to be 0 or 1'); 
end 
if isfield(flags,'checkReport')==false; 
    flags.checkReport=1; 
end 

%% Create function handles 
if flags.mixedFreq==0
    addsol.funcLikel=@likelNanSplitsGeneral;
    addsol.funcKfilter=@kfilterNanSplitsGeneral;
end
fprintf('Using %s for Likelihood\n',func2str(addsol.funcLikel)); 
fprintf('Using %s for Filter\n',func2str(addsol.funcKfilter)); 

